/* h5设计页面的整体数据信息
 * data.js
 */
import { combineReducers } from 'redux';
import Immutable from 'immutable';

import pages from './pages.js';

import {BLANK_H5_DATA} from '../../utils/H5constants';

const initialState={
	attributes:BLANK_H5_DATA.data.attributes,
	loadingPage:{}         //加载页面设置，保留
};

function attributes(state=initialState.attributes,action){
	switch (action.type) {
		case 'INIT_DATA':
			return action.attributes;
		case 'UPDATE_H5DATA_ATTR':
			return {...state,[action.name]:action.value};
	   	default:
		   	return state;
  	}
}

function loadingPage(state=initialState.loadingPage,action){
	switch (action.type) {
		default:
		   	return state;
  	}
}

export default combineReducers({attributes,loadingPage,pages});
